58 research outputs found

    Answer-Type Modification without Tears: Prompt-Passing Style Translation for Typed Delimited-Control Operators

    Full text link
    The salient feature of delimited-control operators is their ability to modify answer types during computation. The feature, answer-type modification (ATM for short), allows one to express various interesting programs such as typed printf compactly and nicely, while it makes it difficult to embed these operators in standard functional languages. In this paper, we present a typed translation of delimited-control operators shift and reset with ATM into a familiar language with multi-prompt shift and reset without ATM, which lets us use ATM in standard languages without modifying the type system. Our translation generalizes Kiselyov's direct-style implementation of typed printf, which uses two prompts to emulate the modification of answer types, and passes them during computation. We prove that our translation preserves typing. As the naive prompt-passing style translation generates and passes many prompts even for pure terms, we show an optimized translation that generate prompts only when needed, which is also type-preserving. Finally, we give an implementation in the tagless-final style which respects typing by construction.Comment: In Proceedings WoC 2015, arXiv:1606.0583

    マルチステージ証明記述言語の設計と開発

    Get PDF
    科学研究費助成事業 研究成果報告書:挑戦的萌芽研究2015-2017課題番号 : 15K1200

    2015 Workshop on Continuations: pre-proceedings

    Get PDF
    This volume contains the papers presented at WoC 2015, the 2015 Workshopon Continuations held on April 12, 2015 in London, UK

    A Practical Unification of Multi-stage Programming and Macros

    Get PDF
    Program generation is indispensable. We propose a novel unification of two existing metaprogramming techniques: multi-stage programming and hygienic generative macros. The former supports runtime code generation and execution in a type-safe manner while the latter offers compile-time code generation. In this work we draw upon a long line of research on metaprogramming, starting with Lisp, MetaML and MetaOCaml. We provide direct support for quotes, splices and top-level splices, all regulated uniformly by a level-counting Phase Consistency Principle. Our design enables the construction and combination of code values for both expressions and types. Moreover, code generation can happen either at runtime à la MetaML or at compile time, in a macro fashion, à la MacroML. We provide an implementation of our design in Scala and we present two case studies. The first implements the Hidden Markov Model, Shonan Challenge for HPC. The second implements the staged streaming library Strymonas

    構成的プログラミングにおける自己反映機構

    Get PDF
    本文データは平成22年度国立国会図書館の学位論文(博士)のデジタル化実施により作成された画像ファイルを基にpdf変換したものである京都大学0048新制・論文博士博士(工学)乙第9307号論工博第3137号新制||工||1047(附属図書館)UT51-96-T527(主査)教授 佐藤 雅彦, 教授 上林 彌彦, 教授 湯淺 太一学位規則第4条第2項該当Doctor of EngineeringKyoto UniversityDFA
    corecore